﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using IHodelBll;
using Microsoft.AspNetCore.Mvc;
using Model;                                

namespace HotelUI.Controllers
{
    public class GuestroomorderController : Controller
    {

        IGuestroomorderBll guestroomorder;

        public GuestroomorderController(IGuestroomorderBll guestroomorderBll) { guestroomorder = guestroomorderBll; }

        public IActionResult Index()
        {
            return View();
        }

        public IActionResult GetOrder()
        {
            return View();
        }

        public IActionResult UpdateOrder()
        {
            return View();
        }


        //<summary>
        //显示客房订单信息
        //</summary>
        //<returns></returns>
        public Task<ActionResult<IEnumerable<Guestroomorder>>> GetRoomOrder(string user)
        {
            return guestroomorder.GetOrder(user);
        }

        /// <summary>
        /// 获取订单客房类型
        /// </summary>
        /// <returns></returns>
        public Task<ActionResult<IEnumerable<Guestroomtype>>> GetOrderoomType()
        {
            return guestroomorder.GetOrderoomType();
        }

        /// <summary>
        /// 新增客房订单
        /// </summary>
        /// <param name="guestroomorder"></param>
        public Task<ActionResult<int>> AddRoomOrder(Guestroomorder roomorder)
        {
            return guestroomorder.AddRoomOrder(roomorder);
        }

        /// <summary>
        /// 客房订单的详情
        /// </summary>
        /// <param name="oid"></param>
        /// <returns></returns>
        public ActionResult<Guestroomorder> DataSingle(int oid)
        {
            return guestroomorder.DataSingle(oid);
        }

        /// <summary>
        /// 删除客房订单
        /// </summary>
        /// <param name="oid"></param>
        /// <returns></returns>
        public Task<ActionResult<int>> DeleteOrder(int oid)
        {
            return guestroomorder.DeleteOrder(oid);
        }

        /// <summary>
        /// 修改客房订单
        /// </summary>
        /// <param name="guestroomorder"></param>
        /// <returns></returns>
        public Task<ActionResult<int>> UpRoomOrder(Guestroomorder guestroomorders)
        {
            return guestroomorder.UpdateOrder(guestroomorders);
        }
    }
}
